package com.dlwx.firefighting.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.dlwx.firefighting.R;
import com.dlwx.firefighting.bean.OrderConfirmBean;

/**
 * Created by Administrator on 2017/9/4.
 */

public class OrderConfirmAdapter extends ListBaseAdapter<OrderConfirmBean.GoodsListBean> {

    private Context context;
    public OrderConfirmAdapter(Context context) {
        super(context);
        this.context=context;
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_oder_confirm;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        OrderConfirmBean.GoodsListBean bean = getDataList().get(position);
        ImageView imageView=holder.getView(R.id.imageView);
        TextView nameTv=holder.getView(R.id.name_tv);
        TextView goodsMoneyTv=holder.getView(R.id.goods_money_tv);
        TextView numTv=holder.getView(R.id.num_tv);
       /* TextView expressTv=holder.getView(R.id.express_tv);
        TextView countMoneyTv=holder.getView(R.id.count_money_tv);*/

        Glide.with(context).load(bean.getGoods_thumb()).error(R.mipmap.error_small).into(imageView);
        nameTv.setText(bean.getGoods_name());
        String price=bean.getGoods_price();
        goodsMoneyTv.setText(context.getString(R.string.rmb)+price);
        numTv.setText(context.getString(R.string.x)+bean.getGoods_number());

    }
}
